package com.zyx.inputStream;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) {
        FileInputStream fis = null;
        File file = new File("F:\\nsdJava\\java0720.txt");
        try {
            fis = new FileInputStream(file);


            StringBuffer sb = new StringBuffer();
            int content;
            while ((content = fis.read()) != -1) {
                sb.append((char) content);
            }
            System.out.println(sb);

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fis != null) {
                try {
                    fis.close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
    }
}